package com.jiker.order;

import com.jiker.Area;
import com.jiker.Coordinates;
import com.jiker.Direction;

/**
 * @author leo
 * @date 2021/6/16
 */
public class TurnLeft extends Move {

    public TurnLeft(Area area) {
        super(area);
    }

    @Override
    public Coordinates move(Coordinates coordinates) {
        switch (coordinates.getDirection()) {
            case SOUTH:
                coordinates.setDirection(Direction.EAST);
                break;
            case WEST:
                coordinates.setDirection(Direction.SOUTH);
                break;
            case NORTH:
                coordinates.setDirection(Direction.WEST);
                break;
            case EAST:
                coordinates.setDirection(Direction.NORTH);
                break;
            default:
        }
        return coordinates;
    }
}
